package Day11.Demo07;

/**
 * @author hyhWTX
 * @version 1.0
 * @date 2022年05月14日 16:57
 */


public class Hero {
    private String name;//名称
    private Skill skill;//技能

    public Hero() {
    }

    public Hero(String name, Skill skill) {
        this.name = name;
        this.skill = skill;
    }

    public void attack(){
        System.out.println("我叫："+name+"我来释放技能。");
        skill.use();//调用接口

        System.out.println("释放技能完成。");
    }
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Skill getSkill() {
        return skill;
    }

    public void setSkill(Skill skill) {
        this.skill = skill;
    }
}
